package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.entity.QueryPageBean;
import com.itheima.pojo.CheckItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CheckItemDao {
    @Insert("insert into t_checkitem(code,name,sex,age,price,type,attention,remark) " +
            "values(#{code},#{name},#{sex},#{age},#{price},#{type},#{attention},#{remark})")
    public void save(CheckItem checkItem);
    @Select("select * from t_checkitem where code like #{queryString} or name like #{queryString}")
    Page<CheckItem> findByPage(QueryPageBean pageBean);
    @Delete("delete from t_checkitem where id=#{id}")
    void deleteById(int id);
    @Select("select * from t_checkitem where id=#{id}")
    CheckItem findById(int id);
    @Update("update t_checkitem set code=#{code},name=#{name},sex=#{sex},age=#{age},price=#{price},type=#{type},attention=#{attention},remark=#{remark} where id=#{id}")
    void update(CheckItem checkItem);
    @Select("select * from  t_checkitem ")
    List<CheckItem> findAll();
}
